<?php
namespace app\center\logic;

class MyCpLogic extends BaseLogic {

    /**
     * 获取我的社区巡店查询条件
     * @param $openid
     * @param $start_time
     * @param $end_time
     * @return array
     */
    public function get_search_my_cp_maps($openid,$start_time,$end_time){
        $maps = [];
        $maps[] = ['openid','=',$openid];

        if(!empty($start_time) && !empty($end_time)){
            $maps[] = ['start_time','between',[$start_time . ' 00:00:00',$end_time . ' 23:59:59']];
        }else{
            if(!empty($start_time)){
                $maps[] = ['start_time','>',$start_time . ' 00:00:00'];
            }
            if(!empty($end_time)){
                $maps[] = ['start_time','<',$end_time . ' 23:59:59'];
            }
        }

        return $maps;
    }
}